package cn.miui.mall.controller;

import cn.miui.mall.dao.imagedao;
import cn.miui.mall.pojo.product_details;
import cn.miui.mall.pojo.selected_image;
import cn.miui.mall.pojo.selected_type;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/Image")
public class ImageController {
    @Autowired
    private imagedao image;
    @RequestMapping("/xiangqing")
    public String xiangqing(String url,Integer id){
       String type="xiangqing";
       if (url.equals("白色")){
           type="bai";
       }
       for (selected_image im: image.findBydetailsidAndType(id,type)) {
              url=im.getImage();
       }
       return url;
    }
}
